package tiasw;

/**
 * Title:        Turnout In a Small World
 * Description:  Program to study how neighborhood influence propagates turnout behavior.
 * Copyright:    Copyright (c) 2002
 * Company:      Harvard University
 * @author James Fowler
 * @version 1.0
 */

import uchicago.src.sim.gui.*;
import uchicago.src.sim.engine.*;

// We create the GUI class through subclassing from the Model class.
public class ModelGUI extends Model {

// GUI variables

/////////////////////////////////////////////////////////////////////////

  // The constructor of the GUI
  public ModelGUI() {
  }

/////////////////////////////////////////////////////////////////////////

  // Initializing the GUI model /////////////////////////////////////////////
  public void setup() {
    // Initializing the original model first
    super.setup();

    // Specify the parameters to be displayed for setting by the user
    // Note that we removed numPlayers as that's not an independent
    // parameter anymore, but it rather depends on worldSize.
    params = new String[] { "numCitizens", "aveDegree", "rewireRate","corr"
    ,"imitationRate","numDiscussions"};
  }

/////////////////////////////////////////////////////////////////////////

  // The method to build the Model's internals //////////////////////////
  // Here we build the model instrumentation after the model itself has
  // been built.
  public void buildModel() {
    // Build the original model first
    super.buildModel();

    // Build the GUI-part
  }

/////////////////////////////////////////////////////////////////////////
//  Iterated methods ////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////

  // The activity of the timestep ///////////////////////////////////////
  // In each time step, first execute the model step and then update the
  // graph
  public void step() {
    // Do the original model's step() method first
    super.step();

    // Do the GUI-part of it by updating the graph and the display
  }

/////////////////////////////////////////////////////////////////////////
// RePast Parameter Panel Methods ///////////////////////////////////////
/////////////////////////////////////////////////////////////////////////

  // In the following we provide get/set methods for all the parameters
  // we listed in params (see the setup() method)

  public int getNumCitizens() {
    return numCitizens;
  }

  public void setNumCitizens(int n) {
    numCitizens = n;
  }

  public double getCorr() {
    return corr;
  }

  public void setCorr(double c) {
    corr = c;
  }

  public int getAveDegree() {
    return aveDegree;
  }

  public void setAveDegree(int d) {
    aveDegree = d;
  }

  public double getRewireRate() {
    return rewireRate;
  }

  public void setRewireRate(double r) {
    rewireRate = r;
  }

  public double getImitationRate() {
    return imitationRate;
  }

  public void setImitationRate(double r) {
    imitationRate = r;
  }

  public int getNumDiscussions() {
    return numDiscussions;
  }

  public void setNumDiscussions(int n) {
    numDiscussions = n;
  }


/////////////////////////////////////////////////////////////////////////
// Creating and starting your model /////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
  public static void main(String[] args) {
    SimInit init = new SimInit();
    // We MUST create a ModelGUI object instead of an instance of Model
    // as in the parent class, in order to get the GUI functionality.
    Model m = new ModelGUI();
    init.loadModel(m, null, false);
  }
}